package com.sakana.polymorphismdemo1;

public class Test {
    public static void main(String[] args) {
        /*Person p1=new Person("zhangsan",30);
        Dog dog=new Dog("黑",2);
        p1.keepPet(dog,"骨头");

        Person p2=new Person("lisi",25);
        Cat cat=new Cat("白",3);
        p2.keepPet(cat,"鱼");*/

        Person person=new Person("zhangsan",12);
        Dog d=new Dog("黑",2);
        Cat c=new Cat("白",3);

        person.keepPet(d,"骨头");
        person.keepPet(c,"鱼");

    }
}
